package com.zk.spring5.service;

/**
 * @author ZK
 * @Description
 * @time 2021/5/5 22:42
 * @note
 */

import com.zk.spring5.bean.User;
import com.zk.spring5.dao.UserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserService {
    @Autowired
    private UserDao userDao;

    public void addUser(User user) {
        userDao.addUser(user);
    }

    public void updateUser(User user) {
        userDao.updateUser(user);
    }

    public void deleteUser(Integer userId) {
        userDao.deleteUser(userId);
    }

    public int getUserCount() {
        return userDao.getCount();
    }

    public User getUserById(Integer userId) {
        return userDao.getOneUserById(userId);
    }

    public void batchAddUsers(List<Object[]> batchArgs) {
        userDao.batchAddUsers(batchArgs);
    }

    public void batchDeleteUsers(List<Object[]> batchArgs) {
        userDao.batchDeleteUsers(batchArgs);
    }

    public void batchUpdateUsers(List<Object[]> batchArgs) {
        userDao.batchUpdateUsers(batchArgs);
    }

}
